<template>
	<el-cascader ref="test" :show-all-levels="true" filterable clearable :options="options" v-model="contentValue"
		:props="props" placeholder="请选择或搜索">
	</el-cascader>
</template>

<script>
	export default {
		data() {
			return {
				props: {
					value: 'id',
					label: 'name',
					leaf: 'isLeaf',
					multiple: true,
					emitPath: false,
					disabled: (data, node) => {
						return false;
						// this.params.filter[0].value == node.level;
					}
				},
				options: []
			};
		},
		mounted() {
			this.getTree()


			console.error(this.params.filter[0].value)
		},
		props: {
			modelValue: {
				type: String,
				default: ""
			},
			params: {
				type: Object,
				default: () => {}
			}
		},
		computed: {
			contentValue: {
				get() {
					return this.modelValue
				},
				set(val) {
					this.$emit('update:modelValue', val);
				}
			}
		},
		methods: {
			async getTree() {
				var res = await this.$API.system.custGroup.dictionary.post(this.params);
				this.options = res.data;
			}
		}
	};
</script>
